﻿@model IEnumerable<MvcApplication6.Models.EventModel>
@using MvcApplication6.Models
@using MvcPaging
@using MvcApplication6.common
    @if (Model.Count<EventModel>() > 0)
    {
            <div class="pr-head"><span>Tin Khuyến mãi</span>
              @if (Session["checkLoginAbcuser"] != null)
                  { 
                       @* <a  href="Admin/AddNews_2?CategoryEventId=7" >Thêm Tin khuyến mãi</a>*@
                         @Html.ActionLink("Thêm Tin khuyến mãi",
                                              "AddNews_2",   // <-- ActionMethod
                                            "Admin",  // <-- Controller Name.
                                            new
                                            {
                                                CategoryEventId = 7
                                            }, // <-- Route arguments.
                                            null
                                            )
                  }
			<div class="clear"></div>
                <ul class="list1">
                    @foreach (var eventModel in Model)
                    {
                        <li>
                       @* @Ajax.ImageActionLink(
                                    "../../Upload/Images/" + @eventModel.Image,
                                    "",
                                    "NewDetail",
                                    new
                                    {
                                        Id = @eventModel.Id
                                    },
                                    new AjaxOptions
                                    {
                                        HttpMethod = "GET",
                                        InsertionMode = InsertionMode.Replace,
                                        UpdateTargetId = "listProduct"
                                    }
                                )*@
                            <a href="/Home/NewDetail/@eventModel.Title.Replace(" ", "")/@eventModel.Id">
                                <img src="http://aptechpro.vn/Upload/Images/@eventModel.Image" />
                            </a>
                         <div class="zoom">
                       @*  @Ajax.ActionLink(
                            @eventModel.Title,
                            "NewDetail",
                            new
                            {
                                Id = @eventModel.Id
                            },
                            new AjaxOptions
                            {
                                HttpMethod = "GET",
                                InsertionMode = InsertionMode.Replace,
                                UpdateTargetId = "listProduct"
                            }
                            )*@
                             <a href="/Home/NewDetail/@eventModel.Title.Replace(" ", "")/@eventModel.Id">
                                 @eventModel.Title
                             </a>
                         <br />
                         <p>@eventModel.Title2</p>
                         </div>

                         @if (Session["checkLoginAbcuser"] != null)
                         { 
                            @*<a  href="/Admin/AddNews?EventId=@eventModel.Id">Sửa</a> *@
                             
                              @Html.ActionLink("Sửa",
                                            "AddNews",   // <-- ActionMethod
                                            "Admin",  // <-- Controller Name.
                                            new
                                            {
                                                EventId = @eventModel.Id
                                            }, // <-- Route arguments.
                                            null
                                            )
                        
                        @Ajax.ActionLink(
                            "Xóa",
                            "DeleteSale",
                            new
                            {
                                Id = @eventModel.Id

                            },
                            new AjaxOptions
                            {
                                HttpMethod = "GET",
                                InsertionMode = InsertionMode.Replace,
                                UpdateTargetId = "listProduct",
                                OnBegin = "myonbegin",
                                OnSuccess = "myonsuccess",
                                OnFailure = "myonfailure"
                            }
                            )
                             }

                         </li>
                    
                    }

                    




                     
                </ul>

            </div>
     
    }
    else
    { 
            <div class="pr-head"><span>Không Có Tin Khuyến mãi</span></div>
    }


